package com.qst.crop.dao;

import com.qst.crop.entity.Address;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface AddressDao {
    int insertSelective(Address address);

    List<Address> selectByExample(@Param("name")String name);

    Address selectOneByExample(String name,String isDef);
    /**
     * 更新
     * @param address
     * @return
     */
    int updateByPrimaryKey(Address address);

    Address selectByPrimaryKey(Integer id);

    /**
     * 删除
     * @param id
     * @return
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * 新增收货地址
     * @param address
     * @return
     */
    int add(Address address);

    /**
     * 查询全部收货地址
     * @param name
     * @return
     */
    List<Address> selectByOwnName(String name);


    Address selectDefaultByOwnName(String name);


    int setDefaultAddress(String username);




}
